package com.yb.search_integration;

/**
 * @program: algorithm_and_data_structure
 * @description: 测试算法工具类1.1
 * @author: Mr.Bo
 * @create: 2020-07-25 20:15
 **/
public class TestMyArraySearch {
    public static void main(String[] args) {
        MyArray mArray = new MyArray();
        mArray.add(1);
        mArray.add(2);
        mArray.add(3);
        mArray.add(4);
        mArray.add(5);
        // 调用线性查找方法
        int index = mArray.search(4);
        System.out.println("index:"+index);
        // 调用二分查找法
        int index2 = mArray.binarySearch(4);
        System.out.println("index2:"+index2);
    }
}
